{temp('admin/head')}
<link rel="stylesheet" href="{$adstyle}/js/datatables/dataTables.bootstrap.css">
<script src="{$adstyle}/js/art/artDialog.source.js?skin=opera"></script>
<script src="{$adstyle}/js/art/plugins/iframeTools.source.js"></script>

</head>

<body class="page-body">	
		{temp('admin/left')}
			{temp('admin/top')}			
			<!-- Basic Setup -->
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">{$tit}</h3>
					<div class="panel-options">

					</div>
				</div>
				
				<div class="panel-body">
					<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#example-1").dataTable({
							"oLanguage": {
								"sUrl":"{$adstyle}/js/datatables/js/zn.txt"
							},
							aLengthMenu: [
								[15, 25, 50, 100, -1], [15, 25, 50, 100, "All"]
							]
						});
					});
					</script>
					
					 <div class="row">
					{if(@$dir)}
						{foreach($dir as $k=>$v)}
						{if(@$v['lcv'])}
						<div class="col-sm-3">
							<a 
							{if($v['name'] == 'pc')}
							href="../admin/?act=tempgl&met=temp_list&id={$id}&pch=1&pa={prt(base64_encode($v['path']))}{$gnpd}">
							{elseif($v['name'] == 'phone')}
							href="../admin/?act=tempgl&met=temp_list&id={$id}&pch=2&pa={prt(base64_encode($v['path']))}{$gnpd}">
							{elseif($v['name'] == 'weixin')}
							href="../admin/?act=tempgl&met=temp_list&id={$id}&pch=3&pa={prt(base64_encode($v['path']))}{$gnpd}">
							{/if}
							{if(@$v['lst'])}
							<img src="{$v['sy_src']}" width="150px" height="150px"  title="点击进入下一级" style="cursor:pointer;border:1px;"/>
							{else}
							<img src="{$adstyle}/images/zw.png" width="150px" height="150px"  title="点击进入下一级" style="cursor:pointer;border:1px;"/>
							{/if}
							</a>
							<p style="margin-top:5px;">
							<span class="btn btn-secondary btn-icon icon-left" >
								{$v['name']}
							</span>
							</p>
						</div>
						{/if}
						{/foreach}
					{else}
						暂无数据
					{/if}
					
					</div> 
			{if(@!$v['lcv'])}
				 <table id="example-1" class="table table-striped table-bordered" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th>名称</th>
								<th>类型</th>
								<th>大小(kb)</th>
								<th>最后修改时间</th>
								<th>操作</th>
							</tr>
						</thead>

						<tbody>
						{if(@$dir)}
							{foreach($dir as $k=>$v)}
							<tr>
								<td  > 
								{if(@$v['xx']['type'] == 1)}
									<a href="{$_url}/admin/?act=tempgl&met=temp_list&id={$id}&pa={prt(base64_encode($v['path']))}{$gnpd}" style="cursor:pointer;">
									<img width="20" height="16" src="{$adstyle}/images/folder.png" complete="complete"/>
									{$v['name']}
									</a>
								{else} 
									{$v['name']}
								{/if}
								</td>
								<td>{$v['xx']['lx']}</td>
								<td>{$v['xx']['size']}</td>
								<td>{$v['lastime']}</td>
								<td>
									<span  onclick="del({$k})" class="btn btn-danger btn-icon icon-left"> 
										删除
									</span>
									{if(@$v['xx']['type'] == 2)}
										 <a  href="{$_url}/admin/?act=tempgl&met=zxedit&pa={prt(base64_encode($v['path']))}&id={$tempid}{$gnpd}" class="btn btn-secondary btn-icon icon-left">
											在线编辑
										</a> 
										<a  href="{$_url}/admin/?act=tempgl&met=textedit&pa={prt(base64_encode($v['path']))}&id={$tempid}{$gnpd}" class="btn btn-info btn-icon icon-left">
											文本编辑
										</a>
                                        <!-- <span class="btn btn-info btn-icon icon-left" onClick="editname({$k})">
                                      		  改名
                                        </span> -->
									{/if}
									{if(@$v['xx']['type'] == 3)}
										<a  href="{$_url}/admin/?act=tempgl&met=textedit&pa={prt(base64_encode($v['path']))}&id={$tempid}{$gnpd}" class="btn btn-info btn-icon icon-left" >
											文本编辑
										</a>

									{/if}
									{if(@$v['xx']['type'] == 4)}
										<a  href="{$_url}/admin/?act=tempgl&met=ylimg&pa={prt(base64_encode($v['path']))}&id={$tempid}{$gnpd}" target="_blank" class="btn btn-info btn-icon icon-left">
											预览图片
										</a>
									{/if}
									{if(@$v['xx']['type'] == 1)}
									<a href={$_url}/admin/?act=tempgl&met=temp_list&id={$id}&pa={prt(base64_encode($v['path']))}{$gnpd}" class="btn btn-secondary btn-icon icon-left">
										查看下一级
									</a>
									{/if}
								</td>
							</tr>
							<div style="display:none;"><input type="text" value="{prt(base64_encode($v['path']))}" id="pat_{$k}"/></div>
							{/foreach}
						{/if}
						</tbody>
					</table>  
				{/if}
				</div>
			</div>
		{temp('admin/foot')}
		
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>
	<script src="{$adstyle}/js/datatables/js/jquery.dataTables.min.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datatables/dataTables.bootstrap.js"></script>
	<script src="{$adstyle}/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
	<script src="{$adstyle}/js/datatables/tabletools/dataTables.tableTools.min.js"></script>
	
	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script> 
	
	<script>
	function del(k){   //删除
		var pa = document.getElementById('pat_'+k).value;
		var msg = "确定要删除么？"
		if(confirm(msg) == true){
			$.post('{$_url}/admin/?act=tempgl&met=del{$gnpd}',{pa:pa},function(data){ 	
				if(data == 'cg'){
					location.href = '';
				}else{
					alert(data);
				}
			});
		}else{
			return false;
		}		
	}
	function editname(k){   //编辑名称
		var pa = document.getElementById('pat_'+k).value;
		art.dialog.open('{$_url}/admin/?act=tempgl&met=alert&pa='+pa+'{$gnpd}',{id:'alert',title:'',lock:true},false);
	}
	function closealert(){   //关闭编辑名称的弹窗
		art.dialog.list['alert'].close();
	}
	</script>

</body>
</html>